using System;

namespace UserManagementService.DTOs;

/// <summary>
/// 用户活动日志DTO
/// </summary>
public class UserActivityLogDto
{
    /// <summary>
    /// 日志ID
    /// </summary>
    public Guid Id { get; set; }

    /// <summary>
    /// 用户ID
    /// </summary>
    public Guid UserId { get; set; }

    /// <summary>
    /// 用户名
    /// </summary>
    public string UserName { get; set; }

    /// <summary>
    /// 操作类型
    /// </summary>
    public ActivityType ActivityType { get; set; }

    /// <summary>
    /// 操作描述
    /// </summary>
    public string Description { get; set; }

    /// <summary>
    /// 请求URL
    /// </summary>
    public string RequestUrl { get; set; }

    /// <summary>
    /// HTTP方法
    /// </summary>
    public string HttpMethod { get; set; }

    /// <summary>
    /// IP地址
    /// </summary>
    public string IpAddress { get; set; }

    /// <summary>
    /// 浏览器信息
    /// </summary>
    public string Browser { get; set; }

    /// <summary>
    /// 操作系统信息
    /// </summary>
    public string OperatingSystem { get; set; }

    /// <summary>
    /// 请求参数
    /// </summary>
    public string RequestParameters { get; set; }

    /// <summary>
    /// 操作结果
    /// </summary>
    public ActivityResult Result { get; set; }

    /// <summary>
    /// 错误信息
    /// </summary>
    public string ErrorMessage { get; set; }

    /// <summary>
    /// 处理时长（毫秒）
    /// </summary>
    public long Duration { get; set; }

    /// <summary>
    /// 操作时间
    /// </summary>
    public DateTime ActivityTime { get; set; }

    /// <summary>
    /// 租户ID
    /// </summary>
    public Guid? TenantId { get; set; }
}

/// <summary>
/// 活动类型枚举
/// </summary>
public enum ActivityType
{
    /// <summary>
    /// 登录
    /// </summary>
    Login = 1,

    /// <summary>
    /// 登出
    /// </summary>
    Logout = 2,

    /// <summary>
    /// 创建资源
    /// </summary>
    Create = 3,

    /// <summary>
    /// 更新资源
    /// </summary>
    Update = 4,

    /// <summary>
    /// 删除资源
    /// </summary>
    Delete = 5,

    /// <summary>
    /// 查看资源
    /// </summary>
    View = 6,

    /// <summary>
    /// 导出数据
    /// </summary>
    Export = 7,

    /// <summary>
    /// 导入数据
    /// </summary>
    Import = 8,

    /// <summary>
    /// 修改密码
    /// </summary>
    ChangePassword = 9,

    /// <summary>
    /// 重置密码
    /// </summary>
    ResetPassword = 10
}

/// <summary>
/// 活动结果枚举
/// </summary>
public enum ActivityResult
{
    /// <summary>
    /// 成功
    /// </summary>
    Success = 1,

    /// <summary>
    /// 失败
    /// </summary>
    Failed = 2,

    /// <summary>
    /// 超时
    /// </summary>
    Timeout = 3
}